import 'dart:convert';

RechargeConfigEntity rechargeConfigEntityFromJson(String str) => RechargeConfigEntity.fromJson(json.decode(str));

String rechargeConfigEntityToJson(RechargeConfigEntity data) => json.encode(data.toJson());

class RechargeConfigEntity {
  String? bankId;
  String? weixinId;
  String? alipayId;
  Bank? bank;
  Alipay? weixin;
  Alipay? alipay;

  RechargeConfigEntity({
    required this.bankId,
    required this.weixinId,
    required this.alipayId,
    required this.bank,
    required this.weixin,
    required this.alipay,
  });

  factory RechargeConfigEntity.fromJson(Map<String, dynamic> json) => RechargeConfigEntity(
    bankId: json["bank_id"],
    weixinId: json["weixin_id"],
    alipayId: json["alipay_id"],
    bank: Bank.fromJson(json["bank"]),
    weixin: Alipay.fromJson(json["weixin"]),
    alipay: Alipay.fromJson(json["alipay"]),
  );

  Map<String, dynamic> toJson() => {
    "bank_id": bankId,
    "weixin_id": weixinId,
    "alipay_id": alipayId,
    "bank": bank?.toJson(),
    "weixin": weixin?.toJson(),
    "alipay": alipay?.toJson(),
  };
}

class Alipay {
  String? payImg;

  Alipay({
    required this.payImg,
  });

  factory Alipay.fromJson(Map<String, dynamic> json) => Alipay(
    payImg: json["pay_img"],
  );

  Map<String, dynamic> toJson() => {
    "pay_img": payImg,
  };
}

class Bank {
  String bankAccount;
  String bankPayName;
  String bankName;

  Bank({
    required this.bankAccount,
    required this.bankPayName,
    required this.bankName,
  });

  factory Bank.fromJson(Map<String, dynamic> json) => Bank(
    bankAccount: json["bank_account"],
    bankPayName: json["bank_pay_name"],
    bankName: json["bank_name"],
  );

  Map<String, dynamic> toJson() => {
    "bank_account": bankAccount,
    "bank_pay_name": bankPayName,
    "bank_name": bankName,
  };
}